package com.miao.admin.controller;


import com.miao.admin.entity.vo.CustomerVO;
import com.miao.admin.service.AdminCustomerService;
import com.miao.common.entity.R;
import com.miao.common.entity.pojo.Customer;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * 顾客信息表(Customer)表控制层
 *
 * @author MiaoWenqing
 * @since 2021-02-02 21:17:57
 */
@RestController
@RequestMapping("admin/customer")
public class AdminCustomerController {
    /**
     * 服务对象
     */
    @Resource
    private AdminCustomerService adminCustomerService;


    @GetMapping("/all")
    public R cusAll(){
        List<CustomerVO> customerVOS = this.adminCustomerService.cusAll();
        return  R.ok(customerVOS);
    }

    @GetMapping("/get")
    public R getOne(String cusId){
        Customer customer = this.adminCustomerService.getById(cusId);
        customer.setCusPasswd(null);
        return R.ok(customer);
    }




}